﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace PdfSdk.PdfViewer
{
    public class PageWrapper : ObjectWrapper
    {
        public PageWrapper(object obj) : base(obj)
        {
        }

        public System.Windows.Size PageRowbounds
        {
            get => (System.Windows.Size)GetFieldValue();
            set => SetFieldValue(value);
        }

        public int c_gapBetweenPages => Convert.ToInt32(GetFieldValue());

        public InkCanvas Canvas => GetPropertyValue() as InkCanvas;

        public SelectionCanvasWrapper CanvasEx
        {
            get
            {
                if (GetPropertyValue("Canvas") is InkCanvas inkCanvas)
                    return new SelectionCanvasWrapper(inkCanvas);
                return null;
            }
        }

        public double Rotation => Convert.ToDouble(GetPropertyValue());

        public bool IsTextSelectionStarted
        {
            get => Convert.ToBoolean(GetPropertyValue());
            set => SetPropertyValue(value);
        }

        public bool IsTextSelectionCompleted
        {
            get => Convert.ToBoolean(GetPropertyValue());
            set => SetPropertyValue(value);
        }
    }
}
